package StudyCode.summary.regularexpressionsmatch;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class MatchingWordBoundaryUsingB {
	public static void main(String[] args) {
		String regex = "\\bapple\\b";
		String replacementStr = "orange";
		String inputStr = "I have an apple and five pineapples";
		String newStr = inputStr.replaceAll(regex, replacementStr);

		System.out.println("正则表达式: " + regex);
		System.out.println("输入字符串: " + inputStr);
		System.out.println("替换字符串: " + replacementStr);
		System.out.println("新字符串: " + newStr);
	}
}
